#!/usr/bin/python
# -*- coding: UTF-8 -*-

import sys
import fontforge
from readsvg import set_config
from svgs2ttf import setProperties, addGlyphs
from bmp2svg import generate_svg


def main():
    # generate_svg()                            # bmp转储svg
    config = set_config()                      # 生成字体属性文件
    font = fontforge.font()                    # 生成字库
    setProperties(font, config)                # 添加属性
    addGlyphs(font, config)
    for outfile in config['output']:
        sys.stderr.write('Generating %s...\n' % outfile)
        font.generate(outfile)


if __name__ == '__main__':
    main()
